import request from '../../utils/request';

// 话题分类管理相关 API

// 更新话题分类
export const updateTopicCategory = (data: any) => {
    return request({
        url: '/content/api/topic-category',
        method: 'put',
        data
    });
};

// 创建话题分类
export const createTopicCategory = (data: any) => {
    return request({
        url: '/content/api/topic-category',
        method: 'post',
        data
    });
};

// 删除话题分类
export const deleteTopicCategory = (id: string) => {
    return request({
        url: `/content/api/topic-category/${id}`,
        method: 'delete'
    });
};

// 查询所有话题分类
export const getAllTopicCategories = (language: string) => {
    return request({
        url: `/content/api/topic-category/all/${language}`,
        method: 'get'
    });
};

// 批量查询话题分类信息
export const getTopicCategoriesBatch = (params: any) => {
    return request({
        url: '/content/api/topic-category/batch',
        method: 'get',
        params
    });
};

// 批量删除话题分类
export const deleteTopicCategoriesBatch = (data: any) => {
    return request({
        url: '/content/api/topic-category/batch',
        method: 'delete',
        data
    });
};

// 查询话题分类列表
export const getTopicCategoryList = (params: any) => {
    return request({
        url: '/content/api/topic-category/list',
        method: 'get',
        params
    });
};

// 分页查询话题分类列表
export const getTopicCategoryPage = (params: any) => {
    return request({
        url: '/content/api/topic-category/page',
        method: 'get',
        params
    });
};

// 根据ID查询话题分类详情
export const getTopicCategoryById = (id: string) => {
    return request({
        url: `/content/api/topic-category/${id}`,
        method: 'get'
    });
};
